<template>
  <div class="left">
    <div>left组件 --- 传递数据：{{count}}</div>
    <button type="button" class="btn btn-success" @click="add">+1</button>
  </div>
</template>

<script>
import bus from './EventBus.js';
export default {
  name: 'MyLeft',
  data() {
    return {
      count: 0
    };
  },
  methods: {
    add() {
      this.count += 1;
      bus.emit('countChange', this.count);
    }
  }
};
</script>

<style scoped>
.left {
  height: 200px;
  width: 50%;
}
</style>